package com.purebang.spaceinvaders;

import java.awt.Rectangle;

public class Laser {
	
	private final int HEIGHT = 12;
	private final int WIDTH = 4;
	private final int ySpeed = 10;
	private Rectangle hitbox;
	
	public Laser(Rectangle laserCannonHitbox) {
		//We want to spawn the laser in the middle of the LaserCannon
		int x = laserCannonHitbox.x + ((int) laserCannonHitbox.width / 2 - WIDTH/2);
		int y = laserCannonHitbox.y;
		hitbox = new Rectangle(x,y,WIDTH,HEIGHT);
	}
	
	public void update() {
		hitbox.y = hitbox.y - ySpeed;
	}

	public Rectangle getHitbox() {
		return hitbox;
	}

}
